<!DOCTYPE html>
<html class="x-admin-sm">
    <head>
        <meta charset="UTF-8">
        <title>退货召回列表</title>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
        <link rel="stylesheet" href="/static/css/font.css">
        <link rel="stylesheet" href="/static/css/xadmin.css">
		<link rel="stylesheet" href="/static/css/table.css">
        <script src="/static/lib/layui/layui.js" charset="utf-8"></script>
        <script type="text/javascript" src="/static/js/xadmin.js"></script>
        <!--[if lt IE 9]>
          <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
          <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
        <![endif]-->
    </head>
    <body>
        <div class="x-nav">
          <span class="layui-breadcrumb">
            <a href="">首页</a>
            <a href="">演示</a>
            <a><cite>导航元素</cite></a>
          </span>
          <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" onclick="location.reload()" title="刷新">
            <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i></a>
        </div>
        <div class="layui-fluid">
            <div class="layui-row layui-col-space15">
                <div class="layui-col-md12">
                    <div class="layui-card">
						<form class="layui-form layui-col-space5" action="{:url('shop/order/orderafterlist')}" method="post">
                        <div class="layui-card-body ">
                            <div class="layui-input-inline layui-show-xs-block">
                                    <label>产品分类:</label>
									<div class="layui-input-inline">
										<select name="category_id" id="category_id" lay-filter="zcate">
											<option value="">请选择产品分类</option>
											{volist name="fcat" id="vo"}
											<option value="{$vo.category_id}">{$vo.category_name}</option>
											{/volist}
										</select>
									</div>
                                </div>
								<div class="layui-input-inline layui-show-xs-block">
                                    <label>产品子分类:</label>
									<div class="layui-input-inline">
										<select name="cat_id" id="cat_id" lay-filter="bute">
											<option value="">请选择产品子分类</option>
										</select>
									</div>
                                </div>
								<div class="layui-input-inline layui-show-xs-block">
                                    <label>产品品牌:</label>
									<div class="layui-input-inline">
										<select name="brand_name" id="brand_name">
											<option value="">请选择产品品牌</option>
										</select>
									</div>
                                </div>
								<div class="layui-input-inline layui-show-xs-block">
                                    <label>产品内存:</label>
									<div class="layui-input-inline">
										<select name="memory_name" id="memory_name">
											<option value="">请选择产品内存</option>
										</select>
									</div>
                                </div>
								<div class="layui-input-inline layui-show-xs-block">
                                    <label>产品属性:</label>
									<div class="layui-input-inline">
										<select name="attribute_name" id="attribute_name">
											<option value="">请选择产品属性</option>
										</select>
									</div>
                                </div>
								<div class="layui-input-inline layui-show-xs-block">
                                    <label>产品颜色:</label>
									<div class="layui-input-inline">
										<select name="colour_name" id="colour_name">
											<option value="">请选择产品颜色</option>
										</select>
									</div>
                                </div>
                                {if condition="$ty neq '2'"}
                                <div class="layui-input-inline layui-show-xs-block">
                                    <label>供应商:</label>
									<div class="layui-input-inline">
										<select name="supplier_id">
                                            <option value="">请选择供应商</option>
                                            {volist name="supp" id="vo"}
                                            <option value="{$vo.supplier_id}">{$vo.supplier_name}</option>
                                            {/volist}
                                        </select>
									</div>
                                </div>
                                {/if}
                                <div class="layui-input-inline layui-show-xs-block">
                                    <div class="layui-input-inline">
                                        <input type="hidden" name="ty" value="{$ty}"/>
										<input type="text" name="sreach" id="sreach" placeholder="请输入订单编号" class="layui-input" />
									</div>
									<div class="layui-input-inline">
										<button class="layui-btn" lay-submit="" lay-filter="sreach">
											<i class="layui-icon">&#xe615;</i>
										</button>
									</div>
								</div>
                        </div>
                        <div class="layui-card-header">
							<div style="float:left" class="layui-form">
								<div class="layui-input-inline">
									<select name="shijian">
										<option value="0">本月（默认）</option>
										<option value="1">上月</option>
									</select>
								 </div>
								 <div class="layui-input-inline">
									<input type="text" name="start" id="start" class="layui-input" placeholder="请选择开始时间">
								 </div>
								 <div class="layui-input-inline">
									  <input type="text" name="end" id="end" class="layui-input" placeholder="请选择结束时间">
								 </div>
                                 <div class="layui-input-inline">
									  <button class="layui-btn" lay-submit="" lay-filter="sreach">
											<i class="layui-icon">&#xe615;</i>
										</button>
								 </div>
							</div>
							<div style="float:right">
								<span class="chakan span_nav">退货订单数：{$thdd}</span>
								<span class="chakan span_nav">退货总金额：{$thze}元</span>
							</div>
						</div>
                        </form>
                        <div class="layui-card-body">
                            {volist name="order" id="info"}
                            <div class="layui-tab layui-tab-card" style="margin-bottom:15px;">
							  <ul class="order_table">
								<li>订单编号：{$info.order_sn}</li>
								<li>订单时间：{$info.addtime|date="Y-m-d",###}</li>
								<li>客户姓名：{$info.username}</li>
								<li>联系方式：{$info.phone}</li>
								<li>客户编号：{$info.user_sn}</li>
								<li>营业员：{$info.clerk}</li>
								<li>退款金额（元）：{$info.after_money}</li>
							  </ul>
							  <div class="layui-tab-content">
									<table class="layui-table layui-form">
									  <thead>
										<tr>
										  <th>产品编码</th>
										  <th>产品名称</th>
										  <th>IEMI</th>
										  <th>S/N</th>
										  <th>合同编号</th>
										  <th>数量</th>
										  <th>单位</th>
										  <th>价格（元）</th>
										  <th>售货价类型</th>
										  <th>状态</th>
										  <th>操作</th>
									  </thead>
									  <tbody>
                                        <tr>
										  <td>{$info.ogoods.goods_sn}</td>
										  <td>{$info.ogoods.goods_name}</td>
										  <td>{$info.ogoods.imei}</td>
										  <td>{$info.ogoods.sn}</td>
										  <td>{$info.ogoods.contract_sn}</td>
										  <td>{$info.ogoods.number}</td>
										  <td>{$info.ogoods.unit}</td>
                                          {if condition="$info.ogoods.price_type eq '0'"}
                                          <td>{$info.ogoods.selling_price}</td>
										  <td>零售价</td>
                                          {else /}
                                          <td>{$info.ogoods.trade_price}</td>
										  <td>批发价</td>
                                          {/if}
										  <td>
                                            {switch name="$info.ogoods.is_show"}
                                                {case value="0"}正常{/case}
                                                {case value="1"}退货{/case}
                                                {case value="2"}召回{/case}
                                            {/switch}
                                          </td>
										  <td class="td-manage">
											<button class='layui-btn' onclick="xadmin.open('退货','{:url('shop/order/afterinfo',['id'=>$info.order_after_id])}',1000,600)">查看详情</button>
                                          </td>
										</tr>
									  </tbody>
									</table>
							  </div>
							</div>
							{/volist}
                        </div>
						<div class="layui-card-body ">
                            <div class="page">
                                {$order->render()}
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div> 
        <script>
        layui.use(['form','layer'], function () {
            $ = layui.jquery;
            var form = layui.form;
            var layer = layui.layer;
            var nkname = "{$Think.session.admin.nkname}";
           $('body').on('click', '.zhaohui', function(){
                var get_this = $(this);
                layer.confirm('你确定要召回该商品吗?', function(){
                    var params = {};
                    params.id = get_this.attr('gid');
                    params.nkname = nkname;
                    params.after_type = 2;
                    params.time = 0;
                    $.ajax({
                        type: "POST",
                        url: '/shop/order/orderafter',
                        cache: false, //禁用缓存
                        data: params, //传入组装的参数
                        dataType: "json",
                        success: function (result) {
                                if(result.code==10001){
                                    layer.msg("操作成功", {
                                        icon: 6
                                    },
                                    function() {
                                        //关闭当前frame
                                        xadmin.close();
                                        // 可以对父窗口进行刷新 
                                        xadmin.father_reload();
                                    });
                            }else{
                                layer.msg(message.msg, {
                                    icon: 5
                                },
                                function() {
                                    //关闭当前frame
                                    xadmin.close();
                                    // 可以对父窗口进行刷新 
                                    xadmin.father_reload();
                                });
                            }
                        },
                        error:function () {
                            layer.msg('网络错误', {icon: 5});
                        }
                    })
                });
            });
            
        });

        </script>
        <script type="text/javascript" src="/static/customized/shop/addgoods.js"></script>
        <script type="text/javascript" src="/static/customized/shop/orderlist.js"></script>
    </body>
</html>